# include <iostream>
# include <string>
# include <unordered_set>

using namespace std;

const int N = 100;
string s[N];

int main()
{
    // ios::sync_with_stdio(false);
    // cin.tie(nullptr);

    int n; cin >> n;
    for(int i = 0; i < n; ++i)
        cin >> s[i];
    
    unordered_set<string> unique;
    // unique.reserve(n * (n - 1));

    for(int i = 0; i < n; ++i)
    {
        for(int j = 0; j < n; ++j)
        {
            if(i != j)
            {
                unique.insert(s[i] + s[j]);
            }
        }
    }

    cout << unique.size() << endl;
    return 0;
}